var bMoveable=true;var _VersionInfo="";var outType="";var separator="";document.writeln('<iframe name=meizzDateLayer Author=wayx frameborder=0 style="position:absolute; width:164px; height:223px; z-index:9998; visibility:hidden"></iframe>');var odatelayer;var outObject;var outButton;var outDate="";function initStr(b){var a;a="<style>";a+="INPUT.button{BORDER-RIGHT: "+b+" 1px solid;BORDER-TOP:"+b+" 1px solid;BORDER-LEFT: "+b+"1px solid;";a+="BORDER-BOTTOM: "+b+" 1px solid;BACKGROUND-COLOR: #fff8ec;font-family:宋体;}";a+="TD{FONT-SIZE: 9pt;font-family:宋体;}";a+="A{text-decoration:none;font-weight:bold;color:black}";a+="</style>";a+="<script>";a+="var datelayerx,datelayery;        /*存放日历控件的鼠标位置*/";a+="var bDrag;        /*标记是否开始拖动*/";a+="function document_onmousemove(e){/*在鼠标移动事件中，如果开始拖动日历，则移动日历*/";a+="if(bDrag){";a+='        var DateLayer=parent.document.getElementsByName("meizzDateLayer")[0].style;';a+="                DateLayer.left = parseInt(DateLayer.left)+ e.clientX-datelayerx; /*由于每次移动以后鼠标位置都恢复为初始的位置，因此写法与div中不同*/";a+='if(DateLayer.top=="")DateLayer.top=0;';a+="                DateLayer.top = parseInt(DateLayer.top)+ e.clientY-datelayery;}}";a+="function DragStart(e){                /*开始日历拖动*/";a+="if ((document.all?e.button:e.which)!=1) return;\n";a+='var DateLayer=parent.document.getElementsByName("meizzDateLayer")[0].style;';a+="        datelayerx=e.clientX;";a+="        datelayery=e.clientY;";a+="        bDrag=true;}";a+="function DragEnd(){                /*结束日历拖动*/";a+="        bDrag=false;}";a+="<\/script>";a+='<body onmousemove="document_onmousemove(event)">';a+='<div style="z-index:9999;position: absolute; left:0; top:0;" onselectstart="return false"><span id=tmpSelectYearLayer Author=wayx style="z-index: 9999;position: absolute;top: 3; left: 19;visibility: hidden"></span>';a+='<span id=tmpSelectMonthLayer Author=wayx style="z-index: 9999;position: absolute;top: 3; left: 78;visibility: hidden"></span>';a+="<table border=1 cellspacing=0 cellpadding=0 width=142 height=160 bordercolor="+b+" bgcolor="+b+' Author="wayx">';a+='  <tr Author="wayx"><td width=142 height=23 Author="wayx" bgcolor=#FFFFFF><table border=0 cellspacing=1 cellpadding=0 width=140 Author="wayx" height=23>';a+='  <tr align=center Author="wayx"><td width=16 align=center bgcolor='+b;a+=' onclick="parent.meizzPrevM()" title="Previous month" Author=meizz><a href="javascript:;" style="font-size:12px;color: #ffffff" Author=meizz><</a>';a+='        </td><td width=60 align=center style="font-size:12px;cursor:default" Author=meizz ';a+="onmouseover=\"style.backgroundColor='#FFD700'\" onmouseout=\"style.backgroundColor='white'\" ";a+='onclick="parent.tmpSelectYearInnerHTML(innerHTML.match(/\\d{4}/).toString());" title="Click here to select year"><span Author=meizz id=meizzYearHead></span></td>';a+='<td width=48 align=center style="font-size:12px;cursor:default" Author=meizz onmouseover="style.backgroundColor=\'#FFD700\'" ';a+=' onmouseout="style.backgroundColor=\'white\'" onclick="parent.tmpSelectMonthInnerHTML(innerHTML.match(/\\d\\d?/).toString())"';a+='        title="Click here to select month"><span id=meizzMonthHead Author=meizz></span></td>';a+="        <td width=16 bgcolor="+b+' align=center style="font-size:12px;cursor: hand;color: #ffffff" ';a+=' onclick="parent.meizzNextM()" title="Next month" Author=meizz><a href="javascript:;" style="font-size:12px;color: #ffffff;font:bold" Author=meizz>></a></td></tr>';a+="    </table></td></tr>";a+='  <tr Author="wayx"><td width=142 height=18 Author="wayx">';a+="<table border=1 cellspacing=0 bgcolor="+b+" cellpadding=0  "+(bMoveable?'onmousedown="DragStart(event)" onmouseup="DragEnd()"':"");a+=" BORDERCOLORLIGHT="+b+' BORDERCOLORDARK=#FFFFFF width=140 height=20 Author="wayx" style="cursor:'+(bMoveable?"move":"default")+'">';a+='<tr Author="wayx" align=center valign=bottom><td style="font-size:12px;color:#FFFFFF" title="Sunday" Author=meizz>S</td>';a+='<td style="font-size:12px;color:#FFFFFF" title="Monday" Author=meizz>M</td><td style="font-size:12px;color:#FFFFFF" title="Tuesday" Author=meizz>T</td>';a+='<td style="font-size:12px;color:#FFFFFF" title="Wednesday" Author=meizz>W</td><td style="font-size:12px;color:#FFFFFF" title="Thursday" Author=meizz>T</td>';a+='<td style="font-size:12px;color:#FFFFFF" title="Friday" Author=meizz>F</td><td style="font-size:12px;color:#FFFFFF" title="Saturday" Author=meizz>S</td></tr>';a+="</table></td></tr>";a+='  <tr Author="wayx"><td width=142 height=120 Author="wayx">';a+="    <table border=1 cellspacing=2 cellpadding=0 BORDERCOLORLIGHT="+b+' BORDERCOLORDARK=#FFFFFF bgcolor=#fff8ec width=140 height=120 Author="wayx">';var c=0;for(j=0;j<5;j++){a+=' <tr align=center Author="wayx">';for(i=0;i<7;i++){a+="<td width=20 height=20 id=meizzDay"+c+' style="font-size:12px" Author=meizz onclick=parent.meizzDayClick(this.innerHTML.match(/\\d+/).toString(),0)></td>';c++}a+="</tr>"}a+='      <tr align=center Author="wayx">';for(i=35;i<39;i++){a+="<td width=20 height=20 id=meizzDay"+i+' style="font-size:12px" Author=wayx onclick="parent.meizzDayClick(this.innerHTML.match(/\\d+/).toString(),0)"></td>'}a+='        <td colspan=3 align=right Author=meizz><a href="javascript:parent.clear_outObj();" onclick="parent.closeLayer();" style="font-size:12px;text-decoration:underline;font-weight:300;"';a+='         Author=meizz title="'+_VersionInfo+'">Close</a> </td></tr>';a+='    </table></td></tr><tr Author="wayx"><td Author="wayx">';a+='        <table border=0 cellspacing=1 cellpadding=0 width=100% Author="wayx" bgcolor=#FFFFFF>';a+='          <tr Author="wayx"><td Author=meizz align=left><input Author=meizz type=button class=button value="<<" title="Previous year" onclick="parent.meizzPrevY()" ';a+='             onfocus="this.blur()" style="font-size: 12px; height: 20px; width:20px;" id=button2 name=button2><input Author=meizz class=button title="Previous month" type=button ';a+='             value="< " onclick="parent.meizzPrevM()" onfocus="this.blur()" style="font-size: 12px; height: 20px; width:20px" id=button3 name=button3></td><td ';a+='             Author=meizz align=center><input Author=meizz type=button class=button value=Today onclick="parent.meizzToday()" ';a+='             onfocus="this.blur()" title="Current date" style="font-size: 12px; height: 20px; width:40px; cursor:hand" id=button4 name=button4></td><td ';a+='             Author=meizz align=right><input Author=meizz type=button class=button value=" >" onclick="parent.meizzNextM()" ';a+='             onfocus="this.blur()" title="Next month" class=button style="font-size: 12px; height: 20px; width:20px;" id=button5 name=button5><input ';a+='             Author=meizz type=button class=button value=">>" title="Next year" onclick="parent.meizzNextY()"';a+='             onfocus="this.blur()" style="font-size: 12px; height: 20px;width:20px;" id=button6 name=button6></td>';a+="</tr></table></td></tr></table></div></body>";return a}function initcalendar(a){window.frames.meizzDateLayer.document.writeln(initStr(a));window.frames.meizzDateLayer.document.close();odatelayer=window.frames.meizzDateLayer.document}function setday(n,k,q,s){if(arguments.length>4){alert("对不起！传入本控件的参数太多！");return}if(arguments.length==0){alert("对不起！您没有传回本控件任何参数！");return}outType=q;if(s!=null){separator=s}var h=document.getElementsByName("meizzDateLayer")[0];var g=h.style;if(outObject!=k||g.visibility=="hidden"){var c=n;var l=n.offsetTop;var p=n.offsetHeight;var f=n.offsetLeft;var t=n.type;while(n=n.offsetParent){l+=n.offsetTop;f+=n.offsetLeft}var m=document.body.clientWidth;var b=document.body.clientHeight;if(f+h.clientWidth>m){f-=(f+h.clientWidth-m)}if(l+p+h.clientHeight>b){l-=(l+h.clientHeight-b)}g.top=l+p+"px";g.left=f+"px";outObject=(arguments.length==1)?c:k;outButton=(arguments.length==1)?null:c;if(outType=="yyyymm"){var e=/^(\d+)-(\d{1,2})$/}else{var e=/^(\d+)-(\d{1,2})-(\d{1,2})$/}var a=outObject.value.match(e);if(a!=null){a[2]=a[2]-1;if(outType=="yyyymm"){var o=new Date(a[1],a[2],1);if(o.getFullYear()==a[1]&&o.getMonth()==a[2]){outDate=o}else{outDate=""}meizzSetDay(a[1],a[2]+1)}else{var o=new Date(a[1],a[2],a[3]);if(o.getFullYear()==a[1]&&o.getMonth()==a[2]&&o.getDate()==a[3]){outDate=o}else{outDate=""}meizzSetDay(a[1],a[2]+1)}}else{outDate="";meizzSetDay(new Date().getFullYear(),new Date().getMonth()+1)}g.visibility="visible";document.getElementsByName("meizzDateLayer")[0].focus()}}var MonHead=new Array(12);MonHead[0]=31;MonHead[1]=28;MonHead[2]=31;MonHead[3]=30;MonHead[4]=31;MonHead[5]=30;MonHead[6]=31;MonHead[7]=31;MonHead[8]=30;MonHead[9]=31;MonHead[10]=30;MonHead[11]=31;var meizzTheYear=new Date().getFullYear();var meizzTheMonth=new Date().getMonth()+1;var meizzWDay=new Array(39);function document_onclick(a){var b=(document.all)?(a.srcElement):(a.target);if((b.getAttribute("Author")==null||b.getAttribute("Author")=="")&&b!=outObject&&b!=outButton){closeLayer()}}function document_onkeyup(a){if(window.event.keyCode==27){if(outObject){outObject.blur()}closeLayer()}else{if(document.activeElement){if(document.activeElement.getAttribute("Author")==null&&document.activeElement!=outObject&&document.activeElement!=outButton){closeLayer()}}}}function meizzWriteHead(b,a){odatelayer.getElementById("meizzYearHead").innerHTML=b+"";odatelayer.getElementById("meizzMonthHead").innerHTML=a+""}function tmpSelectYearInnerHTML(e){if(e.match(/\D/)!=null){alert("年份输入参数不是数字！");return}var a=(e)?e:new Date().getFullYear();if(a<1000||a>9999){alert("年份值不在 1000 到 9999 之间！");return}var f=a-54;if(f<1000){f=1000}if(f+26>9999){f=9974}var d="<select Author=meizz name=tmpSelectYear style='font-size: 12px' ";d+='onblur=\'document.getElementById("tmpSelectYearLayer").style.visibility="hidden"\' ';d+="onchange='blur();";d+="parent.meizzTheYear = this.value; parent.meizzSetDay(parent.meizzTheYear,parent.meizzTheMonth)'>\r\n";var c=d;for(var b=f;b<f+61;b++){if(b==a){c+="<option Author=wayx value='"+b+"' selected>"+b+"</option>\r\n"}else{c+="<option Author=wayx value='"+b+"'>"+b+"</option>\r\n"}}c+="</select>";odatelayer.getElementById("tmpSelectYearLayer").innerHTML=c;odatelayer.getElementById("tmpSelectYearLayer").style.visibility="visible";odatelayer.getElementsByName("tmpSelectYear")[0].focus()}function tmpSelectMonthInnerHTML(e){if(e.match(/\D/)!=null){alert("月份输入参数不是数字！");return}var a=(e)?e:new Date().getMonth()+1;var d="<select Author=meizz name=tmpSelectMonth style='font-size: 12px' ";d+='onblur=\'document.getElementById("tmpSelectMonthLayer").style.visibility="hidden"\' ';d+="onchange='blur();";d+="parent.meizzTheMonth = this.value; parent.meizzSetDay(parent.meizzTheYear,parent.meizzTheMonth)'>\r\n";var c=d;for(var b=1;b<13;b++){if(b==a){c+="<option Author=wayx value='"+b+"' selected>"+b+"</option>\r\n"}else{c+="<option Author=wayx value='"+b+"'>"+b+"</option>\r\n"}}c+="</select>";odatelayer.getElementById("tmpSelectMonthLayer").style.visibility="visible";odatelayer.getElementById("tmpSelectMonthLayer").innerHTML=c;odatelayer.getElementsByName("tmpSelectMonth")[0].focus()}function closeLayer(){document.getElementsByName("meizzDateLayer")[0].style.visibility="hidden"}function IsPinYear(a){if(0==a%4&&((a%100!=0)||(a%400==0))){return true}else{return false}}function GetMonthCount(a,b){var d=MonHead[b-1];if((b==2)&&IsPinYear(a)){d++}return d}function GetDOW(a,d,b){var c=new Date(b,d-1,a).getDay()/7;return c}function meizzPrevY(){if(meizzTheYear>999&&meizzTheYear<10000){meizzTheYear--}else{alert("年份超出范围（1000-9999）！")}meizzSetDay(meizzTheYear,meizzTheMonth)}function meizzNextY(){if(meizzTheYear>999&&meizzTheYear<10000){meizzTheYear++}else{alert("年份超出范围（1000-9999）！")}meizzSetDay(meizzTheYear,meizzTheMonth)}function meizzToday(){var a;meizzTheYear=new Date().getFullYear();meizzTheMonth=new Date().getMonth()+1;a=new Date().getDate();if(meizzTheMonth<10){meizzTheMonth="0"+meizzTheMonth}if(a<10){a="0"+a}if(outObject){switch(outType){case"yyyymm":outObject.value=meizzTheYear+separator+meizzTheMonth;break;default:outObject.value=meizzTheYear+separator+meizzTheMonth+separator+a}}closeLayer()}function meizzPrevM(){if(meizzTheMonth>1){meizzTheMonth--}else{meizzTheYear--;meizzTheMonth=12}meizzSetDay(meizzTheYear,meizzTheMonth)}function meizzNextM(){if(meizzTheMonth==12){meizzTheYear++;meizzTheMonth=1}else{meizzTheMonth++}meizzSetDay(meizzTheYear,meizzTheMonth)}function meizzSetDay(g,e){meizzWriteHead(g,e);meizzTheYear=g;meizzTheMonth=e;for(var b=0;b<39;b++){meizzWDay[b]=""}var f=1,d=1,c=new Date(g,e-1,1).getDay();for(b=0;b<c;b++){meizzWDay[b]=GetMonthCount(e==1?g-1:g,e==1?12:e-1)-c+b+1}for(b=c;f<GetMonthCount(g,e)+1;b++){meizzWDay[b]=f;f++}for(b=c+GetMonthCount(g,e);b<39;b++){meizzWDay[b]=d;d++}for(b=0;b<39;b++){var a=odatelayer.getElementById("meizzDay"+b);if(meizzWDay[b]!=""){a.style.borderWidth="1px";a.style.borderStyle="solid";a.style.borderTopColor="#FFFFFF";a.style.borderRightColor="#01457c";a.style.borderBottomColor="#01457c";a.style.borderLeftColor="#FFFFFF";if(b<c){a.innerHTML="<a href='javascript:;'><font color=gray>"+meizzWDay[b]+"</font></a>";a.title=(e==1?12:e-1)+"/"+meizzWDay[b];a.onclick=Function("meizzDayClick(this.innerHTML.match(/\\d+/).toString(),-1)");if(!outDate){a.style.backgroundColor=((e==1?g-1:g)==new Date().getFullYear()&&(e==1?12:e-1)==new Date().getMonth()+1&&meizzWDay[b]==new Date().getDate())?"#FFD700":"#e0e0e0"}else{a.style.backgroundColor=((e==1?g-1:g)==outDate.getFullYear()&&(e==1?12:e-1)==outDate.getMonth()+1&&meizzWDay[b]==outDate.getDate())?"#00ffff":(((e==1?g-1:g)==new Date().getFullYear()&&(e==1?12:e-1)==new Date().getMonth()+1&&meizzWDay[b]==new Date().getDate())?"#FFD700":"#e0e0e0");if((e==1?g-1:g)==outDate.getFullYear()&&(e==1?12:e-1)==outDate.getMonth()+1&&meizzWDay[b]==outDate.getDate()){a.style.borderTopColor="#01457c";a.style.borderRightColor="#FFFFFF";a.style.borderBottomColor="#FFFFFF";a.style.borderLeftColor="#01457c"}}}else{if(b>=c+GetMonthCount(g,e)){a.innerHTML="<a href='javascript:;'><font color=gray>"+meizzWDay[b]+"</font></a>";a.title=(e%12+1)+"/"+meizzWDay[b];a.onclick=Function("meizzDayClick(this.innerHTML.match(/\\d+/).toString(),1)");if(!outDate){a.style.backgroundColor=((e==12?g+1:g)==new Date().getFullYear()&&(e==12?1:e+1)==new Date().getMonth()+1&&meizzWDay[b]==new Date().getDate())?"#FFD700":"#e0e0e0"}else{a.style.backgroundColor=((e==12?g+1:g)==outDate.getFullYear()&&(e==12?1:e+1)==outDate.getMonth()+1&&meizzWDay[b]==outDate.getDate())?"#00ffff":(((e==12?g+1:g)==new Date().getFullYear()&&(e==12?1:e+1)==new Date().getMonth()+1&&meizzWDay[b]==new Date().getDate())?"#FFD700":"#e0e0e0");if((e==12?g+1:g)==outDate.getFullYear()&&(e==12?1:e+1)==outDate.getMonth()+1&&meizzWDay[b]==outDate.getDate()){a.style.borderTopColor="#01457c";a.style.borderRightColor="#FFFFFF";a.style.borderBottomColor="#FFFFFF";a.style.borderLeftColor="#01457c"}}}else{a.innerHTML="<a href='javascript:;'>"+meizzWDay[b]+"</a>";a.title=e+"/"+meizzWDay[b];a.onclick=Function("meizzDayClick(this.innerHTML.match(/\\d+/).toString(),0)");if(!outDate){a.style.backgroundColor=(g==new Date().getFullYear()&&e==new Date().getMonth()+1&&meizzWDay[b]==new Date().getDate())?"#FFD700":"#e0e0e0"}else{a.style.backgroundColor=(g==outDate.getFullYear()&&e==outDate.getMonth()+1&&meizzWDay[b]==outDate.getDate())?"#00ffff":((g==new Date().getFullYear()&&e==new Date().getMonth()+1&&meizzWDay[b]==new Date().getDate())?"#FFD700":"#e0e0e0");if(g==outDate.getFullYear()&&e==outDate.getMonth()+1&&meizzWDay[b]==outDate.getDate()){a.style.borderTopColor="#01457c";a.style.borderRightColor="#FFFFFF";a.style.borderBottomColor="#FFFFFF";a.style.borderLeftColor="#01457c"}}}}a.style.cursor="hand"}else{a.innerHTML="";a.style.backgroundColor="";a.style.cursor="default"}}}function meizzDayClick(d,a){var c=meizzTheYear;var b=parseInt(meizzTheMonth)+a;if(b<1){c--;b=12+b}else{if(b>12){c++;b=b-12}}if(b<10){b="0"+b}if(outObject){if(!d){return}if(d<10){d="0"+d}switch(outType){case"yyyymm":outObject.value=c+separator+b;break;default:outObject.value=c+separator+b+separator+d}closeLayer()}else{closeLayer();alert("您所要输出的控件对象并不存在！")}}function clear_outObj(){};
